<?php 
require_once("Elements.php");

class EditInvitation extends Zend_Form {
	
	private $id;
	private $invitation;
	
	public function EditInvitation($id, $invitation) {
		$this->id = $id;
		$this->invitation = $invitation;
		$this->__construct();
	}
	
	public function init() {
		$this->setMethod('post');
		$this->setAttrib('id', 'editInvitation');
		
		$elements = new Elements();
				
		$element = new Zend_Form_Element_Hidden("id");
		$element->setValue($this->id);
		$this->addElement($element);
		
		$element = $elements->getInvitationTitleTextField();
		$element->setValue($this->invitation->title);
		$this->addElement($element);
				
		$element = $elements->getInvitationDescriptionTextareaField();
		$element->setValue($this->invitation->description);
		$this->addElement($element);
		
		$element = $elements->getInvitationAddressTextareaField();
		$element->setValue($this->invitation->address);
		$this->addElement($element);
				
		$element = new Zend_Form_Element_Submit("btnSave");
		$element->setLabel('Save');
		$this->addElement($element);
		
		$element = new Zend_Form_Element_Button("btnCancel");
		$element->setLabel("Cancel");
		$this->addElement($element);
	}
}
?>